5.07.00b16 - Ref only - see manual.

Breaking change to PINCTRL function
GP prefix is now mandatory for start pin parameters. Normal pin numbers can not be used in this function

Breaking changes to SETPIN, to improve compatibility with other MMBasic variants

SETPIN n, m, COM1 ' allocates UART0 pins to COM1. If the pins don't form a UART0 RX/TX pair then errors, pin order is not important
SETPIN n, m, COM2 ' allocates UART1 pins to COM2. If the pins don't form a UART1 RX/TX pair then errors, pin order is not important
SETPIN n, m, p, SPI 'allocates SPI0 pins to SPI. If the pins don't form a SPI0 RX/TX/CLK triple then errors, pin order is not important
SETPIN n, m, p, SPI2 'allocates SPI1 pins to SPI2. If the pins don't form a SPI1 RX/TX/CLK triple then errors, pin order is not important
SETPIN n, m, I2C ' allocates I2C0 pins to I2C. If the pins don't form a I2C0 SDA/SCL pair then errors, pin order is not important
SETPIN n, m, I2C2 ' allocates I2C1 pins to I2C2. If the pins don't form a I2C1 SDA/SCL pair then errors, pin order is not important

Commands are then

OPEN "COM1:baud"
OPEN "COM2:baud"
SPI command and function
SPI2 command and function
I2C command
I2C2 command

PWM will remain unchanged. i.e. SETPIN n, PWMna  where n=0-7 and a=AorB. This reflects the fact on the PicoMite that you can use a PWM B channel without an A unlike any other MM e.g PWM 0,1000,,50

CSUbs

See here for more info

Commands to compile and link for the PicoMite assuming the source file is main.c are

arm-none-eabi-gcc -c -mcpu=cortex-m0 -mfloat-abi=soft -mthumb -Wall -Wno-main -ffunction-sections -O0 -fPIC -I. main.c -o main.o
arm-none-eabi-ld -nostartfiles -T arm-gcc-link.ld -o main.elf main.o


MMBasic for DOS program to convert the .elf file to the Basic statements:

armcfgenV143.zip

Header file for linking in internal routines (untested):

PicoCFunctions.zip



Example source file:
void strrev(unsigned char in[], unsigned char out[]) {

  unsigned int i;

  unsigned int len;

  //MMBasic stores the length of the string in the
  //first,0th,byte
  len=in[0];

  //Set the length of the output string
  out[0]=len;

  //Do the reverse copy
  for(i=1;i<(len+1);i++){
      out[i]=in[len-i+1];
  }

  //and return the length of the string
}
void main(void){}


Compiled output and demo
Dim a$="1234567890"
Dim b$
strrev a$,b$
Print b$

CSub strrev
00000000
B085B480 6078AF00 687B6039 60BB781B B2DA68BB 701A683B 60FB2301 68BAE00D
1AD368FB 687A3301 6839441A 440B68FB 701A7812 330168FB 68BB60FB 68FA3301
D3EC429A BF00BF00 46BD3714 4770BC80
End CSub


Bug fixes
Fixed bug in LONGSTRING RESIZE

Outstanding issues
I haven't looked at led-bloons PIO issue yet


---------------------------------------------------------------

5.07.00b17  -  Ref. only - See manual.

Fixes a bug in the uSec function.
NB: the header file also needs changing

#define uSec(a)                         ((void  (*)(unsigned long long )) Vector_uSec) (a)


New optional parameter for the MATH(MIN and MATH(MAX functions

MATH(MAX array() [,index%])
MATH(MIN array() [,index%])


If index% is included in the function call then it will be updated with the index into the array that was the maximum or minimum. This only works for single dimension arrays. Attempting to use it on multidimensional arrays will give an error. index% must be an integer variable

----------------------------------------------------------------

5.07.00b18  - Ref. only - See manual.

User display is now #25 (untested)

setpin n,intl,myint now allowed on the touch irq pin when GUI functionality is not enabled. If the number of GUI controls is set to something other than 0 then use GUI INTERRUPT. In this case the setpin will error.

Additional parameter on PIO INIT
PIO INIT MACHINE pio%, statemachine%, clockspeed [,pinctrl] [,execctrl] [,shiftctrl][,startinstruction]


The startinstruction parameter tells the PIO which is the first instruction when PIO START is used (was previously always 0)

PIO EXECUTE need now only be used when you want to interrupt an existing program. It immediately terminates the currently executing instruction and starts running from the instruction specified 

-----------------------------------------------------------------

5.07.00b19  - Ref. only - See manual.

Matching the newly available full PicoMite manual.

Note that unlike any other current version of MMBasic the PicoMite will be open source subject to some standard licence conditions. The source will be made available on Github after the first full release.

----------------------------------------------------------------

Manual First Draft released

----------------------------------------------------------------

5.07.00b20

Fixes minor bug in BLIT LOAD

BLIT WRITE no longer needs w and h to be specified as the dimensions of the blit bufffer are now stored with the data
BLIT WRITE [#]b, x, y[, w],[ h]


MM.INFO(ID) returns the unique ID of the Pico Board.
  Quote  
RP2040 does not have an on-board unique identifier (all instances of RP2040 silicon are identical and have no persistent state). However, RP2040 boots from serial NOR flash devices which have a 64-bit unique ID as a standard feature, and there is a 1:1 association between RP2040 and flash, so this is suitable for use as a unique identifier for an RP2040-based board.


Tidy up of some error messages

-----------------------------------------------------------------

5.07.00b21

Fixes bug in re-enabling heartbeat

Minor change to improve compatibility with Linux terminal emulators like minicom

Fixes cut and paste bug in PWM3B, PWM4B, and PWM5B

----------------------------------------------------------------

5.07.00b22

Better and more displays supported

ST7789_320  320x240 display such as this
Options for this display are:
OPTION SDCARD GP22
OPTION SYSTEM SPI GP10,GP11,GP12
OPTION LCDPANEL ST7789_320, LANDSCAPE,GP8,GP15,GP9,GP13
OPTION TOUCH GP16,GP17
GUI CALIBRATE 0, 408, 3901, 900, -646

ST7789_135  240x135 display such as this
Options for this display are:
OPTION SYSTEM SPI GP10,GP11,GP28
OPTION LCDPANEL ST7789, LANDSCAPE,GP8,GP12,GP9



New optional parameter for all LCD displays ILI9163, ILI9341, ST7735, ST7735S, SSD1331 , ST7789, ILI9481, ILI9488, ST7789_135, ST7789_240

OPTION LCDPANEL displaytype, orientation, DCpin, RESETpin, CSpin [,backlightpin]


If the optional backlight pin is specified a PWM will be set up on that pin with a frequency of 1KHz and an initial duty cycle of 99%. You can then use the new BACKLIGHT command to change the brightness between 0 and 100%. The PWM channel is then blocked for normal PWM use and also must not conflict with the PWM channel that may be set up for audio.

BACKLIGHT percentage%

------------------------------------------------------------------

5.07.00b23

Fixes a minor bug in BLIT
Enables BLIT and transparent text for ST7789_320 display
Enables MID$ command (was there but disabled before) 


-----------------------------------------------------------------

5.07.00b24

Implements full I2C slave functionality.
Basically the same as the MM2 except the slave open command is simplified

I2C[2] SLAVE OPEN i2c_slave_address, transmitinterrupt, receiveinterrupt


I2C[2] SLAVE WRITE sendlen, senddata [,sendata ....]

Send the data to the I2C master. This command should be used in the send
interrupt (ie in the 'transmitinterrupt' subroutine when the master has requested data).
Alternatively a flag can be set in the interrupt subroutine and the command
invoked from the main program loop when the flag is set.
'sendlen is the number of bytes to send.
'senddata' is the data to be sent. This can be specified in various ways, see the I2C
WRITE commands for details.


I2C[2] SLAVE READ rcvlen, rcvbuf, rcvd

Receive data from the I2C master device. This command should be used in the
receive interrupt (ie in the 'receiveinterrupt' subroutine when the master has sent some
data). Alternatively a flag can be set in the receive interrupt subroutine and the
command invoked from the main program loop when the flag is set.
'rcvlen' is the maximum number of bytes to receive.
'rcvbuf' is the variable to receive the data. This can be specified in various ways,
see the I2C READ commands for details.
'rcvd' is a variable that, at the completion of the command, will contain the actual
number of bytes received (which might differ from 'rcvlen').


I2C[2] SLAVE CLOSE

Disables the slave I2C module and returns the external I/O pins to a "not
configured" state. They can then be configured using SETPIN.

Exactly like the MM2 you MUST put the I2C[2] SLAVE READ and SLAVE WRITE commands in the interrupt routine or trigger them to respond very quickly afterwards in the main program.

e.g. Connect pin GP2 (pin 4) on the master to GP2 on the slave and GP3 (pin 5) on the master to GP3 on the slave

MASTER Pico
SetPin gp2,gp3,i2c2
I2C2 open 100,1000
i=10
Do
i=i+1
a$=Str$(i)
I2C2 write 50,0,Len(a$),a$
Pause 200
I2C2 read 50,0,8,a$
Print a$
Pause 200

SLAVE Pico
SetPin gp2,gp3,i2c2
I2C2 slave open 50,tint,rint
Do :Loop
'
Sub rint
Local count
'Print "RX"
I2C2 slave read 10,a$,count
Print Left$(a$,count)
End Sub
'
Sub tint
a$=Time$
I2C2 slave write 8,a$
'Print "TX"
End Sub

Loop

------------------------------------------------

5.07.00b25

This release changes the OPTION MEMORY command to make things simpler (I hope). Depending on any MEMORY options you have set it may reset all the options.

Changes:

OPTION MEMORY now has only one parameter. This is the number of KBytes of program memory to set. This can be between 1 and half of the available memory (160Kbytes if no GUI controls are enabled)

OPTION GUI CONTROLS sets the number of GUI controls you want available (defaults to 0). It will automatically change the amount of memory available for variables and the program in a sensible way. i.e. share the memory between them or take it all from the variables if less than 16K has been specified for the program. If the number of GUI controls is reduced the firmware will share the returned memory between the program and variable space

GUI memory is allocated in blocks of 2K which roughly equates to 39 GUI controls

OPTION LIST now shows the memory used in KBytes for the program, the variables, and the gui controls

MM.VER and MM.INFO(VERSION) will both now show the full version including the beta value

e.g this release will give 5.070025

-----------------------------------------------------

5.07.00b26

I've received representations about the problem of a program being lost if it isn't saved after an edit and then there is a power outage or system reset for any reason

b26 addresses this by copying to flash the program every time you exit edit or autosave or LOAD from SDcard (but not FLASH LOAD or FLASH CHAIN for obvious reasons).

In the event of a reset happening you can then restore the last edited program by using the new sub-command FLASH RESTORE BACKUP

In the event of the backup being corrupted you can erase it using FLASH ERASE BACKUP

You should probably execute FLASH ERASE BACKUP after installing this release to make sure the flash area used is clean 


5.07.00b27

AUTORUN ON automatically runs FLASH RESTORE BACKUP.

--------------------------------------------------------

New LCD panels

OPTION LCDPANEL ST7789_135, OR, DC, RESET, CS

for 240x135 version
also supports ST7789 320x240 displays

OPTION LCDPANEL ST7789_320, OR, DC, RESET, CS

----------------------------------------------------------

 